package com.myfoon.model.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "EVENT_VIDEO")
public class EventVideo implements Serializable {    
    private Long id;
    private Event event;
    private Video video;
    
    public EventVideo() {
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Id 
    @GeneratedValue(generator = "EventVideoSequence", strategy = GenerationType.AUTO)
    @SequenceGenerator(name = "EventVideoSequence", allocationSize = 1, sequenceName = "EVENT_VIDEO_SEQ_01")
    @Column(name = "ID")
    public Long getId() {
        return id;
    }

    public void setEvent(Event event) {
        this.event = event;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "EVENT_ID")
    public Event getEvent() {
        return event;
    }

    public void setVideo(Video video) {
        this.video = video;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "VIDEO_ID")
    public Video getVideo() {
        return video;
    }
}
